package com.amit.hibernate;

public class CLab11 {

	public static void main(String[] args) {
		
		CustomerDAO cdao=DAOFactory.getcustomerDAO();
		
		//1.add the customer
		
		CustomerTO cto=new CustomerTO(5,"amit","amit@gmail.com",9999,"Blore","Enabled");
		
		cdao.addCustomer(cto);
		System.out.println("1 Record inserted");
		
		//2.get the customer
		CustomerTO c1=cdao.getcustomerbyCid(2);
		System.out.println(c1.getCid()+" "+c1.getCname()+" "+c1.getEmail()+" "+c1.getPhone()+" "+c1.getCid()+" "+c1.getStatus());
		
		
		//3.delete customer
		cdao.deleteCustomer(2);
		System.out.println("Record deleted");
		
		//4.update customer
		
		CustomerTO c2=cdao.getcustomerbyCid(3);
		c2.setCname("vas");
		c2.setEmail("vas@gmail.com");
		c2.setPhone(999);
		
		cdao.updateCustomer(c2);
		System.out.println("1 record updated");
		
		
		

	}

}
